<?php

/**
 * BaseMovimientotransferencia
 * 
 * This class is member of the DAO layer.
 * 
 * @property integer $id
 * @property integer $idMovimientoCaja
 * @property integer $idBanco
 * @property decimal $importe
 * @property enum $gasto
 * @property integer $idMoneda
 * @property decimal $tipoDeCambio
 * @property date $fecha
 * @property string $observaciones
 * @property timestamp $finsert
 * @property Mtipomoneda $Mtipomoneda
 * @property Movimientodecaja $Movimientodecaja
 * @property Mbanco $Mbanco
 * 
 * @author     Claudio Corlatti <corlatti@gmail.com>
 *  $Id: BaseMovimientotransferencia.php 12 2010-07-06 04:34:57Z corlatti $
 */
abstract class BaseMovimientotransferencia extends Doctrine_Record {
    public function setTableDefinition()
    {
        $this->setTableName('movimientotransferencia');
        $this->hasColumn('id', 'integer', 4, array('type' => 'integer', 'length' => 4, 'primary' => true, 'autoincrement' => true));
        $this->hasColumn('idMovimientoCaja', 'integer', 4, array('type' => 'integer', 'length' => 4, 'notnull' => true));
        $this->hasColumn('idBanco', 'integer', 4, array('type' => 'integer', 'length' => 4, 'notnull' => true));
        $this->hasColumn('importe', 'decimal', 10, array('type' => 'decimal', 'length' => 10, 'notnull' => true, 'scale' => false));
        $this->hasColumn('gasto', 'enum', 5, array('type' => 'enum', 'length' => 5, 'values' => array(0 => 'GASTO', 1 => 'COSTO'), 'notnull' => true));
        $this->hasColumn('idMoneda', 'integer', 4, array('type' => 'integer', 'length' => 4, 'notnull' => true));
        $this->hasColumn('tipoDeCambio', 'decimal', 10, array('type' => 'decimal', 'length' => 10, 'notnull' => true, 'scale' => false));
        $this->hasColumn('fecha', 'date', null, array('type' => 'date', 'notnull' => true));
        $this->hasColumn('observaciones', 'string', 250, array('type' => 'string', 'length' => 250, 'notnull' => true));
        $this->hasColumn('finsert', 'timestamp', null, array('type' => 'timestamp', 'notnull' => true));
		$this->hasColumn('costo', 'decimal', 10, array('type' => 'decimal', 'length' => 10, 'notnull' => true, 'scale' => false));        
    }

    public function setUp()
    {
        $this->hasOne('Mtipomoneda', array('local' => 'idMoneda',
                                           'foreign' => 'id'));

        $this->hasOne('Movimientodecaja', array('local' => 'idMovimientoCaja',
                                                'foreign' => 'id'));

        $this->hasOne('Mbanco', array('local' => 'idBanco',
                                      'foreign' => 'id'));
    }
}
?>